package com.zipking.cloud.springbootmybatis.persistance.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.util.Date;

import java.io.Serializable;

/**
 * <p>
 * 消息投递日志
 * </p>
 *
 * @author kingbird
 * @since 2024-04-04
 */
@TableName("msg_log")
public class MsgLog extends Model<MsgLog> {

    private static final long serialVersionUID = 1L;

    /**
     * 消息唯一标识
     */
    @ExcelProperty(value="msgId")
    @TableId("msg_id")
    private String msgId;
    /**
     * 消息体, json格式化
     */
    @ExcelProperty(value="msg")
    private String msg;
    /**
     * 交换机
     */
    @ExcelProperty(value="exchange")
    private String exchange;
    /**
     * 路由键
     */
    @ExcelProperty(value="routing_key")
    @TableField("routing_key")
    private String routingKey;
    /**
     * 状态: 0投递中 1投递成功 2投递失败 3已消费
     */
    @ExcelProperty(value="status")
    private Integer status;
    /**
     * 重试次数
     */
    @ExcelProperty(value="try_count")
    @TableField("try_count")
    private Integer tryCount;
    /**
     * 下一次重试时间
     */
    @ExcelProperty(value="next_try_time")
    @TableField("next_try_time")
    private Date nextTryTime;
    /**
     * 创建时间
     */
    @ExcelProperty(value="create_time")
    @TableField("create_time")
    private Date createTime;
    /**
     * 更新时间
     */
    @ExcelIgnore
    @TableField("update_time")
    private Date updateTime;


    public String getMsgId() {
        return msgId;
    }

    public MsgLog setMsgId(String msgId) {
        this.msgId = msgId;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public MsgLog setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public String getExchange() {
        return exchange;
    }

    public MsgLog setExchange(String exchange) {
        this.exchange = exchange;
        return this;
    }

    public String getRoutingKey() {
        return routingKey;
    }

    public MsgLog setRoutingKey(String routingKey) {
        this.routingKey = routingKey;
        return this;
    }

    public Integer getStatus() {
        return status;
    }

    public MsgLog setStatus(Integer status) {
        this.status = status;
        return this;
    }

    public Integer getTryCount() {
        return tryCount;
    }

    public MsgLog setTryCount(Integer tryCount) {
        this.tryCount = tryCount;
        return this;
    }

    public Date getNextTryTime() {
        return nextTryTime;
    }

    public MsgLog setNextTryTime(Date nextTryTime) {
        this.nextTryTime = nextTryTime;
        return this;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public MsgLog setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public MsgLog setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        return this;
    }

    @Override
    protected Serializable pkVal() {
        return this.msgId;
    }


}
